//
//  ScratchImageViewController.m
//  20170207
//
//  Created by xuPeng on 2017/9/11.
//  Copyright © 2017年 一直丶黑曼巴. All rights reserved.
//
#import "Header.h"
#import "ScratchImageViewController.h"
#import "MDScratchImageView.h"

@interface ScratchImageViewController ()

@end

@implementation ScratchImageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    

    self.title = @"模仿刮奖界面";
    self.view.backgroundColor = [UIColor orangeColor];
    
//    clipsToBounds：是类View的属性，如果设置为yes，则不显示超出父View的部分
//    
//    masksToBounds：是类CALayer的属性，如果设置为yes，则不显示超出父View layer的部分
    
    self.view.layer.masksToBounds = YES;
    //背景图片
    UIImage *img = [UIImage imageNamed:@"01"];
    UIImageView *imgView = [[UIImageView alloc] initWithImage:img];
    imgView.frame = CGRectMake(50, 400, PW - 100, 123);
    [self.view addSubview:imgView];
    
    MDScratchImageView *mdImageView = [[MDScratchImageView alloc] initWithFrame:CGRectMake(50, 400, PW - 100, 123)];
    
    [mdImageView setImage:[UIImage imageNamed:@"02"] radius:20.f];
    
    [self.view addSubview:mdImageView];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
